import Vue from 'vue'
import VueRouter from "vue-router";
Vue.use(VueRouter)
import article from '@/views/article'
import collect from '@/views/collect'
import layout from '@/views/layout'
import like from '@/views/like'
import user from '@/views/user'
import detail from '@/views/article-detail'
import NotFound from '@/views/NotFound'

const router = new VueRouter({
  // mode:history,
  routes: [
    {path:'/',redirect:'/layout'},
    {
      path: '/layout', component: layout,
      children: [
        { path: '/article', component: article },
        { path: '/collect', component: collect },      
        { path: '/like', component: like },   
        { path: '/user', component: user },
      ]
    },
    { path: '/detail/:id', component: detail },
    { path: '*', component: NotFound },
  ]
})

export default router